package demo5;

public class Student {
    public String id;

    public Student(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null){
            return false;
        }
        if(!(obj instanceof Student)){
            return false;
        }
        Student tmp = (Student)obj;
        if(tmp.id.equals(this.id)){
            return true;
        }
        return false;
    }
}
